home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C
/
Snippets
/
ShowInitAndName
/
1. Simple Example
/
How Friendly.c
< prev
next >
Wrap
Text File
|
1996-01-12
|
1KB
|
64 lines
#ifdef THINK_C
#include "::ShowInitAndName.h"
#else
#include "ShowInitAndName.h"
#endif
/* IMPORTANT: Read "ShowInitAndName.h" first!! */
#ifdef powerc
ProcInfoType __procinfo = kThinkCStackBased;
#endif
void main ( void );
void WaitFor ( long howLongToWaitInSixtiethsOfASecond );
void main ( void )
{
/******************/
/* */
/* SIMPLE EXAMPLE */
/* */
/******************/
/* As soon as possible after your init is called, be sure to show an icon. */
ShowInitAndName ( 138, "How Friendly", nil, noErr, false );
WaitFor ( 90 ); /* Pretend to do actual init work here */
/* As the very last thing your init does, show an icon again (this time indicating you’re allDone). */
ShowInitAndName ( 139, "How Friendly", nil, noErr, true /* <--- allDone */ );
/* That’s it. Was that easy enough? */
/* For more powerful examples, see the Variety Of Examples ("Loch Ness") folder */
}
void WaitFor ( long howLongToWaitInSixtiethsOfASecond )
{
/* This causes a pause during startup - to simulate an init installing itself. */
/* You don’t need this routine in your actual init. */
/* 96/01/11 v1.0.0 David Cook First version */
long timeToFly;
timeToFly = TickCount ( ) + howLongToWaitInSixtiethsOfASecond;
while ( timeToFly > TickCount ( ) )
{
};
}